<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>管理员列表</title>

  <!-- Set render engine for 360 browser -->
  <meta name="renderer" content="webkit">

  <!-- No Baidu Siteapp-->
  <meta http-equiv="Cache-Control" content="no-siteapp"/>

  <link rel="icon" type="image/png" href="${base}/template/assets/i/favicon.png">

  <!-- Add to homescreen for Chrome on Android -->
  <meta name="mobile-web-app-capable" content="yes">
  <link rel="icon" sizes="192x192" href="${base}/template/assets/i/app-icon72x72@2x.png">

  <!-- Add to homescreen for Safari on iOS -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
  <link rel="apple-touch-icon-precomposed" href="${base}/template/assets/i/app-icon72x72@2x.png">

  <!-- Tile icon for Win8 (144x144 + tile color) -->
  <meta name="msapplication-TileImage" content="${base}/template/assets/i/app-icon72x72@2x.png">
  <meta name="msapplication-TileColor" content="#0e90d2">

  <link rel="stylesheet" href="${base}/res/css/amazeui.min.css">
  <link rel="stylesheet" href="${base}/res/css/app.css">
  <link rel="stylesheet" href="${base}/res/css/admin.css">
  <script src="${base}/res/js/jquery.min.js"></script>
  <script type="text/javascript" src="${base}/res/js/list.js"></script>

</head>
<body>
<!--在这里编写你的代码-->
<div class="admin-content">
  <div class="am-cf am-padding" style="padding:1rem 1.6rem 1.6rem 1rem;margin:0px;"> <!--  padding:1px 2px 3px 4px;上、右、下,和左   -->
    <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">商品管理</strong> / <small>管理员列表</small></div>
  </div>
  <form class="am-form" id="listForm" action="${base}/admin/list" method="post">
   <div class="am-g">
     <div class="am-u-sm-12 am-u-md-6" style="padding:0px 1.6rem 1.6rem 1rem;margin:0px;">
       <div class="am-btn-toolbar">
         <div class="am-btn-group am-btn-group-xs" >
           <button type="button" class="am-btn am-btn-default" onclick="location.href='${base}/admin/add'"><span class="am-icon-plus"></span> 新增</button>
           <button type="button" id="deleteButton" disabled="disabled" class="am-btn am-btn-default" onclick="deleteAll('${base}/admin/delete')"><span class="am-icon-trash-o"></span> 删除</button>
         </div>
       </div>
     </div>
     <div class="am-u-sm-12 am-u-md-3">
       <div class="am-form-group">
         <select name="property" data-am-selected="{btnSize: 'sm'}">
           <option value="username" <%if (property! == "username"){%>selected="selected" <%}%>>用户名</option>
		   <option value="name" <%if (property! == "name"){%>selected="selected" <%}%>>姓名</option>
         </select>
       </div>
     </div>
     <div class="am-u-sm-12 am-u-md-3" >
       <div class="am-input-group am-input-group-sm">
         <input type="text" class="am-form-field" name="keyword" value="">
         <span class="am-input-group-btn">
           <button id="searchButton" class="am-btn am-btn-default" type="button">搜索</button>
         </span>
       </div>
     </div>
   </div>
   <div class="am-g" >
     <div class="am-u-sm-12" style="padding:0px 5px 0px 0px;margin:0px;"><!--  padding:1px 2px 3px 4px;上、右、下,和左   -->
         <table class="am-table am-table-striped am-table-bordered am-table-radius am-table-hover table-main" style="padding:0px;margin:0px;">
           <thead>
             <tr>
               <th class="table-check"><input type="checkbox" id="allCheck"></th>
               <th class="table-id">序号</th>
               <th class="table-title">用户名</th>
               <th class="table-type">E-mail</th>
               <th class="table-type">姓名</th>
               <th class="table-type">所属部门</th>
               <th class="table-type">最后登录时间</th>
               <th class="table-type">最后登录IP</th>
               <th class="table-type">状态</th>
               <th class="table-date">创建日期</th>
               <th class="table-set">操作</th>
             </tr>
         </thead>
         <tbody>
         <%for(list in pager.list){%>
         	 <tr>
             <td><input type="checkbox" name="ids" value="${list.id}"></td>
             <td>${listLP.index}</td>
             <td>${list.username}</td>
             <td>${list.email}</td>
             <td>${list.name!"&nbsp;"}</td>
             <td>${list.department!"&nbsp;"}</td>
             <td>
			 	<%if (list.loginDate != null && list.loginDate != ""){%>
					<span title="${list.loginDate,dateFormat="yyyy-MM-dd HH:mm:ss"}">${list.loginDate,dateFormat="yyyy-MM-dd HH:mm:ss"}</span>
				<%}else{%>
					&nbsp;
				<%}%>
			 </td>
             <td>${list.loginIp!"&nbsp;"}</td>
             <td>
             	<%if (list.isAccountEnabled == true && list.isAccountLocked == false && list.isAccountExpired == false && list.isCredentialsExpired == false){%>
					<span class="am-text-primary">正常</span>
				<%}else if (list.isAccountEnabled == false){%>
					<span class="am-text-warning"> 未启用 </span>
				<%}else if (list.isAccountLocked == true){%>
					<span class="am-text-warning"> 已锁定 </span>
				<%}else if (list.isAccountExpired == true){%>
					<span class="am-text-warning"> 已过期 </span>
				<%}else if (list.isCredentialsExpired == true){%>
					<span class="am-text-warning"> 凭证过期 </span>
				<%}%>
             </td>
             <td>${list.modifyDate,dateFormat="yyyy-MM-dd HH:mm:ss"}</td>
             <td>
               <div class="am-btn-toolbar">
                 <div class="am-btn-group am-btn-group-xs">
                   <button type="button" class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="location.href='${base}/admin/edit?id=${list.id}'"><span class="am-icon-pencil-square-o"></span>编辑</button>
                 </div>
               </div>
             </td>
           </tr>
         <%}%>
       </tbody>
       </table>
         <div class="am-cf">
  			<!-- 分页 -->
  			<%if (pager.list.~size > 0){%>
  				<div class="am-fr">
  					<% include("/admin/pager.html"){}%>
  				</div>
  			<%}else{%>
   			<div class="am-kai">
			  <h3>没有找到任何记录!</h3>
			</div>
  			<%}%>
	 </div>
     </div>
   </div>
  </form>
</div>
<!-- content end -->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="${base}/res/js/amazeui.min.js"></script>
<!--<![endif]-->
<!--[if lte IE 8 ]>
<script src="https://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<![endif]-->
</body>
</html>
